<!doctype html>
<html>
<head>
<template source='TPL:admin.common.head' />
</head>
<body>
<div class="wrap J_check_wrap">
	<div class="nav">
		<ul class="cc">
			<li><a href="{@url:medal/medal/run}">勋章管理</a></li>
			<li  class="current"><a href="{@url:medal/medal/award}">勋章颁发</a></li>
			<li><a href="{@url:medal/medal/approval}">勋章审核</a></li>
			<li><a href="{@url:medal/medal/set}">勋章设置</a></li>
		</ul>
	</div>
	
	<div class="h_a">勋章会员筛选</div>
	<div class="search_type cc mb10">
		<form  action="{@url:medal/medal/award}" method="post">
				<label>勋章名称：</label>
				<select id="J_medalid" class="mr10" size="1" name="medalid">
					<option value="0">全部</option>
				<!--# foreach ($medalList as $medal){ #-->
					<option value="{$medal['medal_id']}" {@Pw::isSelected($medal['medal_id'] == $medalId)}>{$medal['name']}</option>
				<!--# } #-->
				</select>
				<label>用户名：</label><input type="text" class="input length_3 mr10" name="username" value="{$username}"/>
			<button class="btn"  type="submit">筛选</button>
		</form>
	</div>

	<!-- <div class="mb10"><a href="{@url:medal/medal/addAward}" title="颁发勋章" class="btn J_dialog"><span class="add"></span>颁发勋章</a></div> -->
	<div class="mb10"><a href="{@url:medal/medal/addAward}" title="颁发勋章" class="btn J_dialog"><span class="add"></span>颁发勋章</a></div>

<!-- list -->
	<form class="J_ajaxForm" data-role="list" action="{@url:medal/medal/batchStop}" method="post">
			<!--# if ($list) { #-->
	<div class="table_list">
		<table width="100%" id="J_subcheck">
			<colgroup>
				<col width="65">
			</colgroup>
			<thead>
				<tr>
					<td><label><input class="J_check_all" data-checklist="J_check_y" data-direction="y" type="checkbox" >全选</label></td>
					<td>用户名</td>
					<td>勋章名称</td>
					<td>勋章图标</td>
					<td>发放时间</td>
					<td>有效期</td>
					<td>操作</td>
				</tr>
			</thead>
			<!--# foreach ($list as $log){
			$expired = $log['expired_time'] > 0 ? Pw::time2str($log['expired_time']) : '长期'; #-->
			<tr>
				<td><input class="J_check" data-yid="J_check_y" data-xid="J_check_x" type="checkbox" name="logids[]" value="{$log['log_id']}"/></td>
				<td><a href="{@url:medal/medal/award?uid=$log['uid']}">{$users[$log['uid']]['username']}</a></td>
				<td>{$medals[$log['medal_id']]['name']}</td>
				<td><img src="{$medals[$log['medal_id']]['medalImage']}" width="30" height="30" /></td>
				<td>{@Pw::time2str($log['created_time'])}</td>
				<td>{$expired}</td>
				<td><a class="J_ajax_del" data-msg="确定要收回吗？" href="{@url:medal/medal/doStop}" data-pdata="{'logid': '{$log['log_id']}'}">[收回]</a></td>
			</tr>
			<!--# } #-->
		</table>
			<div class="p10"><page tpl='TPL:common.page' page="$page" per="20" count="$count" url="medal/medal/award" args='$args'/></div>
	</div>
			<!--# } else { #-->
				<div class="not_content_mini"><i></i>啊哦，没有符合条件的内容！</div>
			<!--# } #-->
	<!--# if ($list) { #-->
	<!-- list -->
	<div class="btn_wrap">
		<div class="btn_wrap_pd">
			<label class="mr20"><input class="J_check_all" data-checklist="J_check_x" data-direction="x" type="checkbox" />全选</label>
			<button class="btn btn_submit J_ajax_submit_btn" type="submit" data-subcheck="true">收回</button>
		</div>
	</div>
	<!--# } #-->
	</form>
</div>
<template source='TPL:admin.common.footer' />
<!-- <script>
$(function(){
	//勋章数据，1 2是key
	var MEDAL_JSON = {@$jsonMedals|json};
	
	var receivetype = $('#J_receivetype');
	
	//切换
	receivetype.on('change', function(){
		medalSelect($(this).val());
	});
	
	//页面载入
	medalSelect(receivetype.val());

	//切换下拉
	function medalSelect(id) {
		var option_arr = [];
		if(id==='0') {
			$.each(MEDAL_JSON, function(i, o){
				$.each(o, function(i, o){
					option_arr.push('<option value="'+ i +'">'+ o +'</option>');
				});
			});
		
		}else{
			$.each(MEDAL_JSON[id], function(i, o){
				option_arr.push('<option value="'+ i +'">'+ o +'</option>');
			});
		}
		//$('#J_medalid').html(option_arr.join(''));
		$('#J_medalid').html('<option value="0">全部</option>'+ option_arr.join(''));
		
	}
});
</script> -->
</body>
</html>